import uuid

from Connector.client import res_success
from service.func.view_resize import view_resize


class CmdViewResize:
    name = "view_resize"
    id = uuid.uuid4()

    def __init__(self, service, Params, Tag, Type):
        self.service = service
        self.params = Params
        self.tag = Tag
        self.type = Type

    async def execute(self):
        width = self.params.get("width")
        height = self.params.get("height")
        print("resize", width, height)
        view_resize(self.service, width, height)
        await res_success(self.tag, self.type, {"status": "ok"})
